package com.perfect

import androidx.annotation.Keep
import androidx.room.*
import com.google.gson.annotations.SerializedName

const val EditBase_DataType_Artist: Byte = 0
const val EditBase_DataType_Brands: Byte = 1
const val EditBase_DataType_BeautySquad: Byte = 2

open class EditBase(
        open var dataType: Byte,
        open var id: Int = 0,
        open var code: String = "",
        open var name: String = "",
        open var eventName: String = "",
        open var selectionMode: Int = 0,
)

@Keep
@Entity(tableName = "brands", indices = [Index(value = ["dataType", "id"])])
class BrandItem(
        var dataType: Byte = 0,
        @PrimaryKey var id: Int = 0,
        var code: String = "",
        var name: String = "",
        var eventName: String = "",
        var selectionMode: Int = 1,
        @Ignore var styleNoList: List<BrandStyleItem>? = null,
        @JvmField var isPrivate: Int = 0,
        var categoryHint: String = "",
        var position: Int = 0
) /*: EditBase(dataType, id, code, name, eventName, selectionMode)*/

@Keep
@Entity(tableName = "account_artist")
class ArtistAccount(
        @PrimaryKey var accountId: String = "",
        var id: Int = 0,
        var code: String = "",
        var name: String = "",
        var eventName: String = "",
        var selectionMode: Int = 0,
        var hintCount: Int = 0,
        var position: Int = 0,
        @Ignore var styleNoList: List<Styles>? = null
) //: EditBase(0, id, code, name, eventName, selectionMode)

@Keep
@Entity(tableName = "brand_style_item", foreignKeys = [ForeignKey(entity = BrandItem::class, parentColumns = ["id"], childColumns = ["parentId"])], indices = [Index(value = ["parentId"])], primaryKeys = ["styleType", "styleNo"])
data class BrandStyleItem(
        var parentId: Int = 0,
        var styleNo: String = "",
        var styleType: Int = 3,
        var sort: Int = 18,
        @JvmField var isLiveStyleShow: Boolean = false,
        @JvmField var isEditShow: Boolean = false
)


@Keep
@Entity(tableName = "makeups", indices = [Index(value = ["accountId"])], foreignKeys = [ForeignKey(entity = ArtistAccount::class, parentColumns = ["accountId"], childColumns = ["accountId"])])
data class Styles(
        @SerializedName("accoutId")
        var accountId: String = "",
        var eventName: String? = null,
        var hintCount: Int = 0,
        @PrimaryKey var hsId: Int = 0,
        var isEditShow: Boolean = true,
        var isLiveStyleShow: Boolean = true,
//        @ColumnInfo(name = "is_new") @SerializedName("isNew")
        @JvmField var isNew: Int = 0,
        var sort: Int = 261,
        var styleNo: String? = null,
        var styleType: Int = 0
)